package modified;
import java.awt.Color;

public abstract class Piece {
  Checker underlyingChecker;

  public Piece(boolean isKing, Player owner, Color color) {
    CheckerColor checkerColor;
    if(color == Color.white) {
      checkerColor = CheckerColor.WHITE;
    }
    else {
      checkerColor = CheckerColor.BLACK;
    }

    underlyingChecker = new Checker(isKing, owner, checkerColor);
  }

  public Piece(Checker underlyingChecker) {
    this.underlyingChecker = underlyingChecker;
  }

  public Color getColor() {
    Color returnedColor;

    if(underlyingChecker.getColor() == CheckerColor.WHITE) {
      returnedColor = Color.white;
    }
    else {
      returnedColor = Color.blue;
    }

    return returnedColor;
  }

  public int getType() {
    int returnedType;

    if(underlyingChecker.isKing()) {
      returnedType = Board.KING;
    }
    else {
      returnedType = Board.SINGLE;
    }

    return returnedType;
  }
}
